package toolsUseCourse.Script;

import java.awt.*;
import java.awt.event.KeyEvent;

// 自动清理Google浏览器缓存的脚本
public class Refresh {
    public static void main(String[] args) throws AWTException {
        google_idea();
        del_google_cache();
        google_idea();
    }

    public static void google_idea() throws AWTException {
        Robot robot = new Robot();
        robot.keyPress(KeyEvent.VK_ALT);
        robot.keyPress(KeyEvent.VK_TAB);
        robot.keyRelease(KeyEvent.VK_TAB);
        robot.keyRelease(KeyEvent.VK_ALT);
    }
    public static void del_google_cache() throws AWTException {
        Robot robot = new Robot();
        robot.keyPress(KeyEvent.VK_CONTROL);
        robot.keyPress(KeyEvent.VK_SHIFT);
        robot.keyPress(KeyEvent.VK_DELETE);
        robot.keyRelease(KeyEvent.VK_DELETE);
        robot.keyRelease(KeyEvent.VK_SHIFT);
        robot.keyRelease(KeyEvent.VK_CONTROL);
        robot.delay(600);
        robot.keyPress(KeyEvent.VK_ENTER);
        robot.keyRelease(KeyEvent.VK_ENTER);
    }

    public static void mouse_to_build() throws AWTException{
        //    480,20
        Robot robot = new Robot();
        int i = 10;
        while (i-- > 0) {
            robot.mouseMove(480, 20);
        }
    }
}
